home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / Include / FWGXUtil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-08  |  2.5 KB  |  128 lines  |  [TEXT/MPS ]

  1. #ifndef FWGXUTIL_H
  2. #define FWGXUTIL_H
  3.  
  4. //========================================================================================
  5. //
  6. //    File:                FWGXUtil.h
  7. //    Release Version:    $ 1.0d11 $
  8. //
  9. //    Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  10. //
  11. //========================================================================================
  12.  
  13. #ifndef FWGXCFG_H
  14. #include "FWGXCfg.h"
  15. #endif
  16.  
  17. #ifdef FW_SUPPORT_GX        // This file is only for QuickDraw GX
  18.  
  19. #ifndef FWSTDDEF_H
  20. #include "FWStdDef.h"
  21. #endif
  22.  
  23. #ifndef FWEXCDEF_H
  24. #include "FWExcDef.h"
  25. #endif
  26.  
  27. #ifdef FWODEXCE_H
  28. #include "FWODExce.h"
  29. #endif
  30.  
  31. #ifndef __GXTYPES__
  32. #include <GXTypes.h>
  33. #endif
  34.  
  35. #if FW_LIB_EXPORT_PRAGMAS
  36. #pragma lib_export on
  37. #endif
  38.  
  39. //========================================================================================
  40. // Forward declarations
  41. //========================================================================================
  42.  
  43. struct Environment;
  44.  
  45. class ODFrame;
  46. class ODShape;
  47. class ODFacet;
  48.  
  49. //========================================================================================
  50. // Global functions
  51. //========================================================================================
  52.  
  53. // General utils
  54.  
  55. FW_Boolean        FW_IsGXInstalled();
  56.  
  57. void            FW_GX_Initialize();
  58. void            FW_GX_Terminate();
  59.  
  60. //========================================================================================
  61. // class FW_CGraphicContextGX
  62. //========================================================================================
  63.  
  64. FW_CLASS_ATTR class FW_CGraphicContextGX FW_AUTO_DESTRUCT_OBJECT
  65. {
  66. // ----- Construction/destruction
  67.  
  68. public:
  69.                     FW_CGraphicContextGX(
  70.                         Environment* ev,
  71.                         ODFacet* facet,
  72.                         ODShape* invalidShape = NULL);
  73.     virtual            ~FW_CGraphicContextGX();
  74.  
  75. // ----- Drawing
  76.  
  77. public:
  78.  
  79.     void            DrawShape(gxShape shape);
  80.     gxTransform        GetGXTransform() const;
  81.  
  82. // ----- Implementation
  83.  
  84. private:
  85.     gxTransform        fGXTransform;
  86.     gxViewPort        fGXViewPort;
  87.  
  88.     // -----
  89.  
  90.     gxMapping        fMapping;
  91.     gxMapping        fOldMapping;
  92.  
  93.     void            SetupTransformMapping(
  94.                         Environment* ev,
  95.                         ODFacet* facet);
  96.                         
  97.     void            RestoreTransformMapping();
  98.  
  99.     // -----
  100.  
  101.     gxShape            fTransformClipOld;
  102.  
  103.     void            SetupTransformClipping(
  104.                         Environment* ev,
  105.                         ODFacet* facet);
  106.  
  107.     void            RestoreTransformClipping();
  108.  
  109.     // -----
  110.  
  111.     gxShape            fViewPortClipOld;
  112.  
  113.     void            SetupViewPortClipping(
  114.                         Environment* ev,
  115.                         ODFacet* facet,
  116.                         ODShape* invalidShape);
  117.  
  118.     void            RestoreViewPortClipping();
  119. };
  120.  
  121. #if FW_LIB_EXPORT_PRAGMAS
  122. #pragma lib_export off
  123. #endif
  124.  
  125. #endif    // FW_SUPPORT_GX
  126.  
  127. #endif    // FWGXUTIL_H
  128.